import { ApiProperty } from '@nestjs/swagger';
import { IsEnum, IsInt, IsOptional, IsString, Length } from 'class-validator';
import { CommonStatus } from '~/common/entity/common.entity';

export class CategoryDto {
  @ApiProperty({ description: '分类名称' })
  @IsString()
  @Length(1, 50)
  name: string;

  @ApiProperty({ description: '分类描述' })
  @IsString()
  @IsOptional()
  description?: string;

  @ApiProperty({ description: '是否启用', enum: CommonStatus, default: CommonStatus.YES })
  @IsEnum(CommonStatus)
  @IsOptional()
  isActive?: CommonStatus;
}